gdkwindow: Apply the 0x0 size bump to 1x1 before checking for the bail
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 3 Jul 2014 15:48:24 +0000 (11:48 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 3 Jul 2014 15:51:54 +0000 (11:51 -0400)
Otherwise, a user that calls gdk_window_resize (window, 0, 0); over and
over won't properly fizzle out, and will queue a redraw. Clipped, but
still. These redraws can be chatty on some platforms like Wayland, and
there's no good reason to not avoid them.

This was the case for resize grips.

gdk/gdkwindow.c

index 0de26c1c8424d316a445d3ee9b11643c70161c82..15d8f0a9df1983cc0151f9c0df59f049a4b72288 100644 (file)
@@ -5355,6 +5355,11 @@ gdk_window_move_resize_internal (GdkWindow *window,
       return;
     }
 
+  if (width == 0)
+    width = 1;
+  if (height == 0)
+    height = 1;
+
   /* Bail early if no change */
   if (window->width == width &&
       window->height == height &&
@@ -5386,11 +5391,7 @@ gdk_window_move_resize_internal (GdkWindow *window,
     }
   if (!(width < 0 && height < 0))
     {
-      if (width < 1)
-       width = 1;
       window->width = width;
-      if (height < 1)
-       height = 1;
       window->height = height;
     }